package com.study.bootstudy.annoation;

import cn.hutool.core.util.DesensitizedUtil;
import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.study.bootstudy.util.SensitiveInfoSerialize;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @Author RenPu
 * @Date 2023/5/20 8:35
 * @Version 1.0
 * @Description: 结合hutool工具实现自定义注解，进行数据信息的脱敏展示
 **/

@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotationsInside
@JsonSerialize(using = SensitiveInfoSerialize.class)
public @interface Sensitive {
  DesensitizedUtil.DesensitizedType value();

}
